package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.model.dto.equipmentdata.EquipmentDataQueryRequest;
import com.cyy.springbootinit.model.entity.EquipmentData;
import com.cyy.springbootinit.model.vo.EquipmentDataVO;
import com.cyy.springbootinit.model.vo.EquipmentInfoAllVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 设备数据表服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface EquipmentDataService extends IService<EquipmentData> {

    /**
     * 校验数据
     *
     * @param equipmentData
     * @param add 对创建的数据进行校验
     */
    void validEquipmentData(EquipmentData equipmentData, boolean add);

    /**
     * 获取查询条件
     *
     * @param equipmentDataQueryRequest
     * @return
     */
    QueryWrapper<EquipmentData> getQueryWrapper(EquipmentDataQueryRequest equipmentDataQueryRequest);
    
    /**
     * 获取设备数据表封装
     *
     * @param equipmentData
     * @param request
     * @return
     */
    EquipmentDataVO getEquipmentDataVO(EquipmentData equipmentData, HttpServletRequest request);

    /**
     * 分页获取设备数据表封装
     *
     * @param equipmentDataPage
     * @param request
     * @return
     */
    Page<EquipmentDataVO> getEquipmentDataVOPage(Page<EquipmentData> equipmentDataPage, HttpServletRequest request);

    List<EquipmentDataVO> getEquipmentDataVoByDormitoryId(Integer dormitoryId);

    Boolean pay(Double money, Integer equipmentId, HttpServletRequest request);

    List<EquipmentInfoAllVO> getEquipmentInfoAll();
}
